<?php
    global $user;
    if (in_array('农户', $user->roles)) {?>
    <div class="contact-div">
        <span>请选择</span>
        <ul class="contact-list">
            <li class="contact-li" style="border-right: 1px solid #CCC">
                <div class="consult">
                    <img src="<?php echo base_path()?>sites/all/themes/tweme/images/images/consult.png"   width="85px">
                    <div class="consult-btn"><?php print render( $form['consult']);?></div>
                </div>
            </li>
            <li class="contact-li">
                <div class="complain">
                    <img src="<?php echo base_path()?>sites/all/themes/tweme/images/images/complain.png" width="85px">
                    <div class="complain-btn"><?php print render( $form['complain']);?></div>
                </div>
            </li>
        </ul>
    </div>
<?php }else {
        ?>

        <?php
        global $user;
        if (in_array('administrator', $user->roles) || in_array('销售员', $user->roles) || in_array('销售管理员', $user->roles)
            || in_array('农化服务员', $user->roles) ||in_array('农化管理员', $user->roles) || in_array('经销商', $user->roles) || in_array('公司领导', $user->roles)
        ) {
//            drupal_goto("contact/chat");
            echo "<script>window.open('" . base_path() . "contact/chat','1446518728896', 'width=542,height=670,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');window.resizeTo(900,750);</script>";
        } else { ?>
            <div class="contact-div">
                <span>友情提示</span>

                <div style="border-top: 1px solid #CCC;  padding: 15px;"><?php print render($form['prompt']); ?></div>
            </div>
        <?php }
    } ?>
<?php print drupal_render_children($form); ?>


<style>
    .close-open {
        width: 90px;
        height: 30px;
        margin-top: 20px;
        border: 0px;
        border-radius: 3px;
        background-color: #c23c3d;
        color: #FFF;
    }

    li.contact-li {
        float: left;
        text-align: center;
        line-height: 35px;
        padding: 8px 32px;
        border-top: 1px solid #CCC;
    }

    ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .contact-div {
        width:300px;
        height: 200px;
        margin-left: auto;
        margin-right: auto;
        margin-top: 40%;
        text-align: center;
        box-shadow: 0 0 34px #CCC;
    }
    .contact-div span {
        line-height: 50px;
        font-weight: bold;
        color: #666;
    }
    .complain-btn a ,
    .consult-btn a {
        color: #000 !important;
        line-height: 50px;
    }
</style>

<script>
    function close_win(){
        window.close();
    }
</script>